package com.stylefeng.guns.modular.fileManage.dao;

import com.stylefeng.guns.common.persistence.model.ZyBrewsPicture;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * 冲泡方式和图片关联表dao
 *
 * @author fengshuonan
 * @date 2017年2月17日20:28:58
 */
@Repository
public interface ZyBrewsPictureDao {

    /**
     * 根据联合主键查询记录
     */
    ZyBrewsPicture selectByTwoId(@Param("brewsId") Integer brewsId, @Param("pictureId") Integer pictureId);

    /**
     * 根据联合主键删除记录
     */
    void deleteByPicIdAndBrewsId(@Param("brewsId") Integer brewsId, @Param("ids") Integer[] ids);



    /**
     * 根据冲泡方式的id和sequence查询关联表
     */
    List<ZyBrewsPicture> selectByBrewsIdAndSequence(@Param("brewsId") Integer brewsId,@Param("sequence")Integer sequence);

    /**
     * 根据冲泡方式的id查询图片
     */
    List<ZyBrewsPicture> selectByBrewsId(@Param("brewsId") Integer brewsId);

    /**
     * 根据图片id删除记录
     */
    void deleteByPicId(@Param("pictureId") Integer pictureId);

    Integer updateByTowId();

    void updateById(ZyBrewsPicture originalZbp);


    /**
     * 根据冲泡方式的id删除关联的记录
     * @param brewsId
     */
    void deleteByBrewsId(@Param("brewsId") Integer brewsId);
}
